package com.mlz.mlzmall.ui.activity.act.personal.NetworkRequest;

import android.app.Activity;
import android.app.ProgressDialog;

/**
 * Created by jack.wang on 2015/11/30.
 */
public class ProgessTools {
    private static ProgressDialog progressDialog;

    /**
     * 显示进度条
     *
     * @param activity
     */
    public static void showProgressDialog(Activity activity, String msg) {
        if (progressDialog == null) {
            progressDialog = new ProgressDialog(activity);
            progressDialog.setMessage(msg);
            progressDialog.setCanceledOnTouchOutside(false);
            progressDialog.show();
        }
    }

    public static void closeProgressDialog() {
        if (progressDialog != null) {
            progressDialog.cancel();
            progressDialog = null;
            System.gc();
        }
    }


}
